// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV })
const db = cloud.database()
exports.main = async (event) => {
    const { id } = event;
    const userInfo = await db.collection('userInfo').doc(id).get()
    const location = db.collection('location');
    const locationList = await location.where({
        _id: db.command.in(userInfo.data.likeLocationIds)
    }).get()
    return {
        data:locationList.data
    }
}
